package Acwing.基础算法;

import java.util.Scanner;

/**
 * @Title: difference
 * @Author 贾金博
 * @Package Acwing.基础算法
 * @Date 2025/4/9 下午6:04
 * @description: 差分
 */
public class difference {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int q = sc.nextInt();
        int[] a = new int[n + 10];
        int[] sum = new int[n + 10];
        sum[0] = 0;

        for(int i = 1; i <= n; i++) {
            a[i] = sc.nextInt();
        }
        while (q-- > 0) {
            int l = sc.nextInt();
            int r = sc.nextInt();
            int x = sc.nextInt();
            sum[l] += x;
            sum[r + 1] -= x;
        }
        for(int i = 1; i <= n; i ++ ) {
            sum[i] += sum[i - 1];
            a[i] += sum[i];
            System.out.print(a[i] + " ");
        }
    }
}
